package org.dong.samples.service;

import java.util.List;
import org.dong.samples.dao.TestHibernateDAO;
import org.dong.samples.model.ExamTest;
import org.dong.samples.model.ExamTestType;
import org.dong.samples.model.PagerModel;
import org.dong.samples.model.vo.ExamTestVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TestHibernateService {
	
	@Autowired
	private TestHibernateDAO testHiberanteDAO;
	
	public List<ExamTest> findAllTest() throws Exception{
		return testHiberanteDAO.findAllTest();
	}
	
	public ExamTest getTestById(Integer id) throws Exception{
		return testHiberanteDAO.getTestById(id);
	}
	
	public void createTest(ExamTest testHiberante) throws Exception{
		testHiberanteDAO.createTest(testHiberante);
	}
	
	public void editTest(ExamTest testHiberante) throws Exception{
		testHiberanteDAO.editTest(testHiberante);
	}
	
	public void deleteTest(Integer id) throws Exception{
		testHiberanteDAO.deleteTest(id);
	}
	
	public List<ExamTestType> findExamTestType() throws Exception{
		return testHiberanteDAO.findExamTestType();
	}
	
	public ExamTestType findByExamTestTypeId(Integer typeId) throws Exception{
		return testHiberanteDAO.findByExamTestTypeId(typeId);
	}
	
	public PagerModel<ExamTestVO> pageFindExamTest() throws Exception{
		return testHiberanteDAO.pageFindExamTest();
	}


}
